package Model;

import java.awt.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 
 * @author stephenbwilliamson
 */
public class Treatment {
	private int sampleID;
	private Gene parent;
	private HashMap<Integer, Subset> subsets;
	private Color color;

	public Treatment(int sampleID) {
		this.sampleID = sampleID;
		subsets = new HashMap<Integer, Subset>();
		this.color = null;
	}

	public boolean hasColor() {
		return color != null;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public Color getColor() {
		return color;
	}

	public int getTreatmentID() {
		return sampleID;
	}

	public void addSubset(Subset subset) {
		subsets.put(subset.getSubsetID(), subset);
	}

	public Subset getSubsetByID(int id) {
		return subsets.get(id);
	}

	public List<Subset> getAllSubsets() {
		return new ArrayList<Subset>(subsets.values());
	}

	public void setGeneParent(Gene gene) {
		parent = gene;
	}

	public Gene getGeneParent() {
		return parent;
	}

	public boolean isEmpty() {
		return subsets.isEmpty();
	}

}
